<?php
/**
 * Copyright 2011  SURFfoundation
 * 
 * This file is part of ESCAPE.
 * 
 * ESCAPE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ESCAPE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with ESCAPE.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information:
 * http://escapesurf.wordpress.com/
 * http://www.surffoundation.nl/
 * 
 * Contact: d.vierkant@utwente.nl
 * 
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3
 */
?>
<?php
	/* @var $repository escape_repository_Repository */
	$repository =& $this->requestAttributes['repository'];
	/* @var $repositoryUi escape_repositoryui_RepositoryUi */
	$repositoryUi =& $this->requestAttributes['repositoryUi'];
	
	$serverUrl = $repository->config['server_url']
?>
<?php print '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?>
<Module>
	<ModulePrefs
<?php
	if($repository->config['opensocial']['description'])
	{
?>
			description="<?php print htmlspecialchars($repository->config['opensocial']['description']); ?>"
<?php
	}
	if($repository->config['opensocial']['author'])
	{
?>
			author="<?php print htmlspecialchars($repository->config['opensocial']['author']); ?>"
<?php
	}
	if($repository->config['opensocial']['screenshot'])
	{
?>
			screenshot="<?php print htmlspecialchars($repository->config['opensocial']['screenshot']); ?>"
<?php
	}
	if($repository->config['opensocial']['title'])
	{
?>
			title="<?php print htmlspecialchars($repository->config['opensocial']['title']); ?>"
<?php
	}
	if($repository->config['opensocial']['title_url'])
	{
?>
			title_url="<?php print htmlspecialchars($repository->config['opensocial']['title_url']); ?>"
<?php
	}
?>
			height="<?php print htmlspecialchars($repository->config['opensocial']['height']); ?>"
<?php
	if($repository->config['opensocial']['thumbnail'])
	{
?>
			thumbnail="<?php print htmlspecialchars($repository->config['opensocial']['thumbnail']); ?>"
<?php
	}
	if($repository->config['opensocial']['author_email'])
	{
?>
			author_email="<?php print htmlspecialchars($repository->config['opensocial']['author_email']); ?>"
<?php
	}
?>			>
		<Require feature="dynamic-height" />
	</ModulePrefs>
	<Content type="html">
<![CDATA[
<iframe src="<?php print htmlspecialchars($serverUrl); ?>/me?gadget=1" scrolling="auto" width="100%" height="<?php print htmlspecialchars($repository->config['opensocial']['height']); ?>" frameborder="0" marginwidth="0" marginheight="0" />
<script type="text/javascript">
	gadgets.window.adjustHeight();
</script>
]]>
	</Content>
</Module>